/**
 * 
 */
package com.pmsco.pms.core.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author Tran Thanh Long
 *
 */
@Entity
@Table(
	name = "PMS_PERMISSION_ROLE"
)
public class PmsPermissionRole {
	private Long id;
	private PmsPermission permission;
	private PmsRole role;
	
	public static String permissionObj = "permission";
	public static String roleObj = "role";
	
	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue
	@Column(name = "ID", nullable = false)
	public Long getId() {
		return id;
	}
	
	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the permission
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PERMISSION_ID", nullable = false)
	public PmsPermission getPermission() {
		return permission;
	}

	/**
	 * @param permission the permission to set
	 */
	public void setPermission(PmsPermission permission) {
		this.permission = permission;
	}

	/**
	 * @return the role
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ROLE_ID", nullable = false)
	public PmsRole getRole() {
		return role;
	}

	/**
	 * @param role the role to set
	 */
	public void setRole(PmsRole role) {
		this.role = role;
	}
}
